package com.kerrykidz.promotion.dao.model;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.kerrykidz.scminvoicing.dao.model.GblScmPrdCateEntity;
import com.kerrykidz.scminvoicing.dao.model.GblScmPrdEntity;
import com.kerrykidz.workflow.vo.WorkflowVo;
import com.rdp.framework.core.model.MyBatisSuperModel;

public class ProCampaignEntity extends MyBatisSuperModel implements Serializable{
	private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	private String status;
	/***
	 * =0 删除
		=1 草稿
		=2 审批中
		=3 完成-同意
		=4 完成-不同意
		=5 关闭
	 */
	/**状态数据*/
	private String statusStr;
	/**审批结果*/
	private String statusCheck;
	
	
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.PK_CAMP_ID
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private String pkCampId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.FK_BRAN_ID
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private String fkBranId;
    private String brankName;

    private String fkFlowinstId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.CAMP_NAME
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private String campName;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.FK_DIS_ID
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private String fkDisId;
    private String disDesc;
    private String disValue;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.START_DATE
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private Date startDate;
    private String startDateStr;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.END_DATE
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private Date endDate;
    private String endDateStr;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.PRD_SCOPE
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private String prdScope;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.DEL_FLAG
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private String delFlag;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.MODI_BY
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private String modiBy;
    private String userName;
    private String overdue;
    private String comments;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column pro_campaign.MODI_TIME
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    private Date modiTime;
    private String modiTimeStr;
    
    private WorkflowVo workflowVo;
    
    private List<GblScmPrdEntity> GblScmPrdList;//商品
    private List<String> prdlist;
    
    private String isRel;//是否是重新申请

    public String getFkFlowinstId() {
		return fkFlowinstId;
	}

	public void setFkFlowinstId(String fkFlowinstId) {
		this.fkFlowinstId = fkFlowinstId;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	/**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.PK_CAMP_ID
     *
     * @return the value of pro_campaign.PK_CAMP_ID
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public String getPkCampId() {
        return pkCampId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.PK_CAMP_ID
     *
     * @param pkCampId the value for pro_campaign.PK_CAMP_ID
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setPkCampId(String pkCampId) {
        this.pkCampId = pkCampId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.FK_BRAN_ID
     *
     * @return the value of pro_campaign.FK_BRAN_ID
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public String getFkBranId() {
        return fkBranId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.FK_BRAN_ID
     *
     * @param fkBranId the value for pro_campaign.FK_BRAN_ID
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setFkBranId(String fkBranId) {
        this.fkBranId = fkBranId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.CAMP_NAME
     *
     * @return the value of pro_campaign.CAMP_NAME
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public String getCampName() {
        return campName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.CAMP_NAME
     *
     * @param campName the value for pro_campaign.CAMP_NAME
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setCampName(String campName) {
        this.campName = campName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.FK_DIS_ID
     *
     * @return the value of pro_campaign.FK_DIS_ID
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public String getFkDisId() {
        return fkDisId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.FK_DIS_ID
     *
     * @param fkDisId the value for pro_campaign.FK_DIS_ID
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setFkDisId(String fkDisId) {
        this.fkDisId = fkDisId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.START_DATE
     *
     * @return the value of pro_campaign.START_DATE
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public Date getStartDate() {
        return startDate;
    }

    public WorkflowVo getWorkflowVo() {
		return workflowVo;
	}

	public void setWorkflowVo(WorkflowVo workflowVo) {
		this.workflowVo = workflowVo;
	}

	/**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.START_DATE
     *
     * @param startDate the value for pro_campaign.START_DATE
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.END_DATE
     *
     * @return the value of pro_campaign.END_DATE
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public Date getEndDate() {
        return endDate;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.END_DATE
     *
     * @param endDate the value for pro_campaign.END_DATE
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    
    public String getStartDateStr() {
    	if(this.startDate != null){
			return sdf.format(this.startDate);
		}
    	return "";
	}

	public void setStartDateStr(String startDateStr) throws ParseException {
		if(StringUtils.isNotBlank(startDateStr)){
			startDateStr = startDateStr.length() > 11 ?startDateStr:startDateStr+" 00:00:00" ;
			this.startDate = sdf.parse(startDateStr);
		}
	}

	public String getEndDateStr() {
		if(this.endDate != null){
			return sdf.format(this.endDate);
		}
    	return "";
	}

	public void setEndDateStr(String endDateStr) throws ParseException {
		if(StringUtils.isNotBlank(endDateStr)){
			endDateStr = endDateStr.length() > 11 ?endDateStr:endDateStr+" 23:59:59" ;
			this.endDate = sdf.parse(endDateStr);
		}
	}

	/**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.PRD_SCOPE
     *
     * @return the value of pro_campaign.PRD_SCOPE
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public String getPrdScope() {
        return prdScope;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.PRD_SCOPE
     *
     * @param prdScope the value for pro_campaign.PRD_SCOPE
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setPrdScope(String prdScope) {
        this.prdScope = prdScope;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.DEL_FLAG
     *
     * @return the value of pro_campaign.DEL_FLAG
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public String getDelFlag() {
        return delFlag;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.DEL_FLAG
     *
     * @param delFlag the value for pro_campaign.DEL_FLAG
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.MODI_BY
     *
     * @return the value of pro_campaign.MODI_BY
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public String getModiBy() {
        return modiBy;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.MODI_BY
     *
     * @param modiBy the value for pro_campaign.MODI_BY
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setModiBy(String modiBy) {
        this.modiBy = modiBy;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column pro_campaign.MODI_TIME
     *
     * @return the value of pro_campaign.MODI_TIME
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public Date getModiTime() {
        return modiTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column pro_campaign.MODI_TIME
     *
     * @param modiTime the value for pro_campaign.MODI_TIME
     *
     * @mbggenerated Tue Aug 05 17:54:39 CST 2014
     */
    public void setModiTime(Date modiTime) {
        this.modiTime = modiTime;
    }

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	

	public String getDisDesc() {
		return disDesc;
	}

	public void setDisDesc(String disDesc) {
		this.disDesc = disDesc;
	}

	public String getDisValue() {
		return disValue;
	}

	public void setDisValue(String disValue) {
		this.disValue = disValue;
	}

	public List<GblScmPrdEntity> getGblScmPrdList() {
		return GblScmPrdList;
	}

	public void setGblScmPrdList(List<GblScmPrdEntity> gblScmPrdList) {
		GblScmPrdList = gblScmPrdList;
	}

	
	public String getModiTimeStr() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		if(this.modiTime != null){
			return sdf.format(this.modiTime);
		}
		return "";
	}

	/**验证是否过期*/
	public String getOverdue(){
		if(this.endDate != null){
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Date dbDate = this.endDate;
			Date currentDate = new Date();
			if(dbDate.getTime() >= currentDate.getTime()){
				return "否";
			}else{
				return "是";
			}
		}else{
			return "-";
		}
		
	}
	/***
	 * =0 删除
		=1 草稿
		=2 审批中
		=3 完成-同意
		=4 完成-不同意
		=5 关闭
	 *//*
	public String getStatusStr() {
		if(StringUtils.isNotBlank(this.status)){
			int statusInt = Integer.valueOf(this.status);
			if(statusInt == 0){
				return " 删除";
			}else if(statusInt == 1){
				return "草稿";
			}else if(statusInt == 2){
				*//**需要获取正在审批用户*//*
				
				return "审批中";
			}else if(statusInt == 3){
				return "完成";
			}else if(statusInt == 4){
				return "完成";
			}else if(statusInt == 5){
				return "关闭";
			}
			return "-";
					
		}else{
			return "-";
		}
	}
*/
	public String getStatusCheck() {
		if(StringUtils.isNotBlank(this.status)){
			int statusInt = Integer.valueOf(this.status);
			if(statusInt == 3){
				return "同意";
			}else if(statusInt == 4){
				return "不同意";
			}
			return "";
					
		}else{
			return "";
		}
	}

	public List<String> getPrdlist() {
		return prdlist;
	}

	public void setPrdlist(List<String> prdlist) {
		this.prdlist = prdlist;
	}

	public String getIsRel() {
		return isRel;
	}

	public void setIsRel(String isRel) {
		this.isRel = isRel;
	}

	public String getBrankName() {
		return brankName;
	}

	public void setBrankName(String brankName) {
		this.brankName = brankName;
	}
	
	
	
	
	
	
    
}